package net.siufung.market.base.dept.config;

import lombok.AllArgsConstructor;
import net.siufung.market.base.dept.mapper.IDeptMapper;
import net.siufung.market.base.dept.provider.UserDeptProvider;
import net.siufung.market.base.user.api.IUserDeptApi;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author 陈建峰
 * @since 2022/5/10 11:13 下午
 */
@Configuration
@MapperScan({"net.siufung.market.base.dept.mapper"})
@AllArgsConstructor
public class MarketDeptAutoConfig {

    private final IDeptMapper deptMapper;

    @Bean
    @Primary
    public IUserDeptApi userDeptApi(){
        return new UserDeptProvider(deptMapper);
    }
}
